Integrand size = 15, antiderivative size = 99 \[ \int \frac {A+B \csc (x)}{a+b \cos (x)} \, dx=\frac {2 A \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b}}+\frac {B \log (1-\cos (x))}{2 (a+b)}-\frac {B \log (1+\cos (x))}{2 (a-b)}+\frac {b B \log (a+b \cos (x))}{a^2-b^2} \]
1/2*B*ln(1-cos(x))/(a+b)-1/2*B*ln(1+cos(x))/(a-b)+b*B*ln(a+b*cos(x))/(a^2- b^2)+2*A*arctan((a-b)^(1/2)*tan(1/2*x)/(a+b)^(1/2))/(a-b)^(1/2)/(a+b)^(1/2 )
Time = 0.28 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.17 \[ \int \frac {A+B \csc (x)}{a+b \cos (x)} \, dx=\frac {-2 A \left (a^2-b^2\right ) \text {arctanh}\left (\frac {(a-b) \tan \left (\frac {x}{2}\right )}{\sqrt {-a^2+b^2}}\right )-\sqrt {-a^2+b^2} B \left ((a+b) \log \left (\cos \left (\frac {x}{2}\right )\right )-b \log (a+b \cos (x))+(-a+b) \log \left (\sin \left (\frac {x}{2}\right )\right )\right )}{(a-b) (a+b) \sqrt {-a^2+b^2}} \]
(-2*A*(a^2 - b^2)*ArcTanh[((a - b)*Tan[x/2])/Sqrt[-a^2 + b^2]] - Sqrt[-a^2 + b^2]*B*((a + b)*Log[Cos[x/2]] - b*Log[a + b*Cos[x]] + (-a + b)*Log[Sin[ x/2]]))/((a - b)*(a + b)*Sqrt[-a^2 + b^2])
Time = 0.50 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 4713, 3042, 4901, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {A+B \csc (x)}{a+b \cos (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \csc (x)}{a+b \cos (x)}dx\) |
\(\Big \downarrow \) 4713 |
\(\displaystyle \int \frac {\csc (x) (A \sin (x)+B)}{a+b \cos (x)}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A \sin (x)+B}{\sin (x) (a+b \cos (x))}dx\) |
\(\Big \downarrow \) 4901 |
\(\displaystyle \int \left (\frac {A}{a+b \cos (x)}+\frac {B \csc (x)}{a+b \cos (x)}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {b B \log (a+b \cos (x))}{a^2-b^2}+\frac {2 A \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b}}+\frac {B \log (1-\cos (x))}{2 (a+b)}-\frac {B \log (\cos (x)+1)}{2 (a-b)}\) |
(2*A*ArcTan[(Sqrt[a - b]*Tan[x/2])/Sqrt[a + b]])/(Sqrt[a - b]*Sqrt[a + b]) + (B*Log[1 - Cos[x]])/(2*(a + b)) - (B*Log[1 + Cos[x]])/(2*(a - b)) + (b* B*Log[a + b*Cos[x]])/(a^2 - b^2)
3.1.8.3.1 Defintions of rubi rules used
Int[(csc[(a_.) + (b_.)*(x_)]*(B_.) + (A_))*(u_), x_Symbol] :> Int[ActivateT rig[u]*((B + A*Sin[a + b*x])/Sin[a + b*x]), x] /; FreeQ[{a, b, A, B}, x] && KnownSineIntegrandQ[u, x]
Int[u_, x_Symbol] :> With[{v = ExpandTrig[u, x]}, Int[v, x] /; SumQ[v]] /; !InertTrigFreeQ[u]
Time = 0.40 (sec) , antiderivative size = 95, normalized size of antiderivative = 0.96
method | result | size |
default | \(\frac {B \ln \left (\tan \left (\frac {x}{2}\right )\right )}{a +b}+\frac {\frac {B b \ln \left (a \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+a +b \right )}{a -b}+\frac {\left (2 A a +2 A b \right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}}{a +b}\) | \(95\) |
risch | \(-\frac {2 i x B \,a^{2} b}{a^{4}-2 a^{2} b^{2}+b^{4}}+\frac {2 i x B \,b^{3}}{a^{4}-2 a^{2} b^{2}+b^{4}}-\frac {i x B}{a +b}+\frac {i x B}{a -b}+\frac {\ln \left ({\mathrm e}^{i x}+\frac {A a -i \sqrt {-A^{2} a^{2}+A^{2} b^{2}}}{A b}\right ) B b}{\left (a +b \right ) \left (a -b \right )}+\frac {\ln \left ({\mathrm e}^{i x}+\frac {A a -i \sqrt {-A^{2} a^{2}+A^{2} b^{2}}}{A b}\right ) \sqrt {-A^{2} a^{2}+A^{2} b^{2}}}{\left (a +b \right ) \left (a -b \right )}+\frac {\ln \left ({\mathrm e}^{i x}+\frac {A a +i \sqrt {-A^{2} a^{2}+A^{2} b^{2}}}{A b}\right ) B b}{\left (a +b \right ) \left (a -b \right )}-\frac {\ln \left ({\mathrm e}^{i x}+\frac {A a +i \sqrt {-A^{2} a^{2}+A^{2} b^{2}}}{A b}\right ) \sqrt {-A^{2} a^{2}+A^{2} b^{2}}}{\left (a +b \right ) \left (a -b \right )}+\frac {B \ln \left ({\mathrm e}^{i x}-1\right )}{a +b}-\frac {B \ln \left ({\mathrm e}^{i x}+1\right )}{a -b}\) | \(357\) |
B/(a+b)*ln(tan(1/2*x))+1/(a+b)*(B*b/(a-b)*ln(a*tan(1/2*x)^2-b*tan(1/2*x)^2 +a+b)+(2*A*a+2*A*b)/((a+b)*(a-b))^(1/2)*arctan((a-b)*tan(1/2*x)/((a+b)*(a- b))^(1/2)))
Time = 3.58 (sec) , antiderivative size = 265, normalized size of antiderivative = 2.68 \[ \int \frac {A+B \csc (x)}{a+b \cos (x)} \, dx=\left [\frac {B b \log \left (b^{2} \cos \left (x\right )^{2} + 2 \, a b \cos \left (x\right ) + a^{2}\right ) - \sqrt {-a^{2} + b^{2}} A \log \left (\frac {2 \, a b \cos \left (x\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (x\right ) + b\right )} \sin \left (x\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (x\right )^{2} + 2 \, a b \cos \left (x\right ) + a^{2}}\right ) - {\left (B a + B b\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + {\left (B a - B b\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{2 \, {\left (a^{2} - b^{2}\right )}}, \frac {B b \log \left (b^{2} \cos \left (x\right )^{2} + 2 \, a b \cos \left (x\right ) + a^{2}\right ) + 2 \, \sqrt {a^{2} - b^{2}} A \arctan \left (-\frac {a \cos \left (x\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (x\right )}\right ) - {\left (B a + B b\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + {\left (B a - B b\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{2 \, {\left (a^{2} - b^{2}\right )}}\right ] \]
[1/2*(B*b*log(b^2*cos(x)^2 + 2*a*b*cos(x) + a^2) - sqrt(-a^2 + b^2)*A*log( (2*a*b*cos(x) + (2*a^2 - b^2)*cos(x)^2 + 2*sqrt(-a^2 + b^2)*(a*cos(x) + b) *sin(x) - a^2 + 2*b^2)/(b^2*cos(x)^2 + 2*a*b*cos(x) + a^2)) - (B*a + B*b)* log(1/2*cos(x) + 1/2) + (B*a - B*b)*log(-1/2*cos(x) + 1/2))/(a^2 - b^2), 1 /2*(B*b*log(b^2*cos(x)^2 + 2*a*b*cos(x) + a^2) + 2*sqrt(a^2 - b^2)*A*arcta n(-(a*cos(x) + b)/(sqrt(a^2 - b^2)*sin(x))) - (B*a + B*b)*log(1/2*cos(x) + 1/2) + (B*a - B*b)*log(-1/2*cos(x) + 1/2))/(a^2 - b^2)]
\[ \int \frac {A+B \csc (x)}{a+b \cos (x)} \, dx=\int \frac {A + B \csc {\left (x \right )}}{a + b \cos {\left (x \right )}}\, dx \]
Exception generated. \[ \int \frac {A+B \csc (x)}{a+b \cos (x)} \, dx=\text {Exception raised: ValueError} \]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?` f or more de
Time = 0.31 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.16 \[ \int \frac {A+B \csc (x)}{a+b \cos (x)} \, dx=\frac {B b \log \left (-a \tan \left (\frac {1}{2} \, x\right )^{2} + b \tan \left (\frac {1}{2} \, x\right )^{2} - a - b\right )}{a^{2} - b^{2}} - \frac {2 \, {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, x\right ) - b \tan \left (\frac {1}{2} \, x\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )} A}{\sqrt {a^{2} - b^{2}}} + \frac {B \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right )}{a + b} \]
B*b*log(-a*tan(1/2*x)^2 + b*tan(1/2*x)^2 - a - b)/(a^2 - b^2) - 2*(pi*floo r(1/2*x/pi + 1/2)*sgn(-2*a + 2*b) + arctan(-(a*tan(1/2*x) - b*tan(1/2*x))/ sqrt(a^2 - b^2)))*A/sqrt(a^2 - b^2) + B*log(abs(tan(1/2*x)))/(a + b)
Time = 3.63 (sec) , antiderivative size = 417, normalized size of antiderivative = 4.21 \[ \int \frac {A+B \csc (x)}{a+b \cos (x)} \, dx=\frac {B\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{a+b}+\frac {\ln \left (3\,B\,a^2\,b^2-2\,B\,b^4-B\,a^4+A\,a\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}+A\,b\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}+A\,a^4\,\mathrm {tan}\left (\frac {x}{2}\right )+A\,b^4\,\mathrm {tan}\left (\frac {x}{2}\right )-B\,a\,b^3+B\,a^3\,b-2\,A\,a^2\,b^2\,\mathrm {tan}\left (\frac {x}{2}\right )+B\,a\,\mathrm {tan}\left (\frac {x}{2}\right )\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-2\,B\,b\,\mathrm {tan}\left (\frac {x}{2}\right )\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}\right )\,\left (A\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-B\,b^3+B\,a^2\,b\right )}{a^4-2\,a^2\,b^2+b^4}-\frac {\ln \left (B\,a^4+2\,B\,b^4-3\,B\,a^2\,b^2+A\,a\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}+A\,b\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-A\,a^4\,\mathrm {tan}\left (\frac {x}{2}\right )-A\,b^4\,\mathrm {tan}\left (\frac {x}{2}\right )+B\,a\,b^3-B\,a^3\,b+2\,A\,a^2\,b^2\,\mathrm {tan}\left (\frac {x}{2}\right )+B\,a\,\mathrm {tan}\left (\frac {x}{2}\right )\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-2\,B\,b\,\mathrm {tan}\left (\frac {x}{2}\right )\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}\right )\,\left (B\,b^3+A\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-B\,a^2\,b\right )}{a^4-2\,a^2\,b^2+b^4} \]
(B*log(tan(x/2)))/(a + b) + (log(3*B*a^2*b^2 - 2*B*b^4 - B*a^4 + A*a*(-(a + b)^3*(a - b)^3)^(1/2) + A*b*(-(a + b)^3*(a - b)^3)^(1/2) + A*a^4*tan(x/2 ) + A*b^4*tan(x/2) - B*a*b^3 + B*a^3*b - 2*A*a^2*b^2*tan(x/2) + B*a*tan(x/ 2)*(-(a + b)^3*(a - b)^3)^(1/2) - 2*B*b*tan(x/2)*(-(a + b)^3*(a - b)^3)^(1 /2))*(A*(-(a + b)^3*(a - b)^3)^(1/2) - B*b^3 + B*a^2*b))/(a^4 + b^4 - 2*a^ 2*b^2) - (log(B*a^4 + 2*B*b^4 - 3*B*a^2*b^2 + A*a*(-(a + b)^3*(a - b)^3)^( 1/2) + A*b*(-(a + b)^3*(a - b)^3)^(1/2) - A*a^4*tan(x/2) - A*b^4*tan(x/2) + B*a*b^3 - B*a^3*b + 2*A*a^2*b^2*tan(x/2) + B*a*tan(x/2)*(-(a + b)^3*(a - b)^3)^(1/2) - 2*B*b*tan(x/2)*(-(a + b)^3*(a - b)^3)^(1/2))*(B*b^3 + A*(-( a + b)^3*(a - b)^3)^(1/2) - B*a^2*b))/(a^4 + b^4 - 2*a^2*b^2)